<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.shopping.service.*" %>
<%@ page import="com.shopping.user.*" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Iterator" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%
	List<User> list = UserService.getUsers();
    System.out.println(list.size());
    
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<table border="1">
	  <tr>
	    <td>用户名</td>
	    <td>联系电话</td>
	    <td>联系地址</td>
	    <td>注册时间</td>
	    <td>处理</td>
	  </tr>
	  <%
	    for(Iterator<User> it = list.iterator();it.hasNext();) {
	    	User u = it.next();
	  %>
	   <tr>
	    <td><%= u.getUsername() %></td>
	    <td><%= u.getPhone() %></td>
	    <td><%= u.getAddr() %></td>
	    <td><%= u.getPdate() %></td>
	    <td><a href="delete.jsp?id=<%= u.getId() %>" target="detail">删除</a></td>
	  </tr>
	  <%
	    }
	  %>
	</table>
</body>
</html>